package com.dctobacco.dongchengtobaccoandroid.ui;

import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.dctobacco.dongchengtobaccoandroid.R;

/**
 * 作者  Administrator
 * 时间  2016/4/5 10:26
 * 文件  DongchengTobaccoAndroid
 * 描述
 */
public class WorkReportFragment extends Fragment {

    OnWorkReportFragmentSelectedListener mCallback;
    //  定义一个接口
    //  必须定义改接口不然会报错
    public interface OnWorkReportFragmentSelectedListener {
        public void onWorkReportFragmentArticleSelected(int position);
    }


    @Override
    public void onAttach(Activity activity) {
        super.onAttach(activity);
        // This makes sure that the container activity has implemented
        // the callback interface. If not, it throws an exception
        try {
            mCallback = (OnWorkReportFragmentSelectedListener) activity;
        } catch (ClassCastException e) {
            throw new ClassCastException(activity.toString()
                    + " must implement OnWorkReportFragmentSelectedListener");
        }
    }


    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_work_report,container,false);
        return view;
    }
}
